Public Class FormAddFriend
    Inherits System.Windows.Forms.Form

#Region " Windows Form Designer generated code "

    Public Sub New()
        MyBase.New()

        'This call is required by the Windows Form Designer.
        InitializeComponent()

        'Add any initialization after the InitializeComponent() call

    End Sub

    'Form overrides dispose to clean up the component list.
    Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
        If disposing Then
            If Not (components Is Nothing) Then
                components.Dispose()
            End If
        End If
        MyBase.Dispose(disposing)
    End Sub

    'Required by the Windows Form Designer
    Private components As System.ComponentModel.IContainer

    'NOTE: The following procedure is required by the Windows Form Designer
    'It can be modified using the Windows Form Designer.  
    'Do not modify it using the code editor.
    Friend WithEvents Button1 As System.Windows.Forms.Button
    Friend WithEvents Button2 As System.Windows.Forms.Button
    Friend WithEvents txtFriendSearch As System.Windows.Forms.TextBox
    Friend WithEvents lstFriendResults As System.Windows.Forms.ListBox
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
        Me.txtFriendSearch = New System.Windows.Forms.TextBox
        Me.Button1 = New System.Windows.Forms.Button
        Me.lstFriendResults = New System.Windows.Forms.ListBox
        Me.Button2 = New System.Windows.Forms.Button
        Me.SuspendLayout()
        '
        'txtFriendSearch
        '
        Me.txtFriendSearch.Location = New System.Drawing.Point(8, 8)
        Me.txtFriendSearch.Name = "txtFriendSearch"
        Me.txtFriendSearch.Size = New System.Drawing.Size(264, 20)
        Me.txtFriendSearch.TabIndex = 0
        Me.txtFriendSearch.Text = "Enter user to search for:"
        '
        'Button1
        '
        Me.Button1.Location = New System.Drawing.Point(280, 16)
        Me.Button1.Name = "Button1"
        Me.Button1.Size = New System.Drawing.Size(104, 23)
        Me.Button1.TabIndex = 1
        Me.Button1.Text = "Search for Friend"
        '
        'lstFriendResults
        '
        Me.lstFriendResults.ColumnWidth = 10
        Me.lstFriendResults.Location = New System.Drawing.Point(8, 40)
        Me.lstFriendResults.Name = "lstFriendResults"
        Me.lstFriendResults.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.lstFriendResults.SelectionMode = System.Windows.Forms.SelectionMode.MultiExtended
        Me.lstFriendResults.Size = New System.Drawing.Size(376, 186)
        Me.lstFriendResults.TabIndex = 2
        '
        'Button2
        '
        Me.Button2.Location = New System.Drawing.Point(288, 232)
        Me.Button2.Name = "Button2"
        Me.Button2.Size = New System.Drawing.Size(88, 23)
        Me.Button2.TabIndex = 3
        Me.Button2.Text = "Add Friend(s)"
        '
        'FormAddFriend
        '
        Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
        Me.ClientSize = New System.Drawing.Size(392, 262)
        Me.Controls.Add(Me.Button2)
        Me.Controls.Add(Me.lstFriendResults)
        Me.Controls.Add(Me.Button1)
        Me.Controls.Add(Me.txtFriendSearch)
        Me.Name = "FormAddFriend"
        Me.Text = "frmAddFriend"
        Me.ResumeLayout(False)

    End Sub

#End Region

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        If Not txtFriendSearch.Text = vbNullString Then
            sktMain.Send("SEARCHFOR_" + txtFriendSearch.Text)
        Else
            sktMain.Send("SEARCHFOR_%")
        End If
    End Sub
    Private Sub txtFriendSearch_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles txtFriendSearch.KeyDown
        If txtFriendSearch.Text.Length() > 25 And txtFriendSearch.Text = "Enter user to search for:" Then
            txtFriendSearch.Text = e.KeyData
        End If
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        For x As Integer = 0 To lstFriendResults.Items.Count - 1
            If lstFriendResults.GetSelected(x) = True Then
                sktMain.Send("ADDFRIEND_" + lstFriendResults.Items.Item(x))
            End If
        Next
        Me.Close()
    End Sub

    Private Sub FormAddFriend_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    End Sub
End Class
